package com.vcredit.bird.vo.identity;

import java.io.IOException;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.vcredit.creditcat.exception.IdAuthException;
import com.vcredit.framework.util.JacksonUtil;

public class YTBaseRes implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@JsonProperty("FacePairDes")
	private String facePairDes;
	@JsonProperty("FacePairState")
	private Integer facePairState;
	@JsonProperty("OcrResult")
	private String ocrResult;
	@JsonProperty("FacePairResult")
	private String facePairResult;
	@JsonProperty("Facebag")
	private String facebag;

	public YTOCRResult getYTOcrResult() throws IdAuthException, JsonParseException, JsonMappingException, IOException {
		if (null == ocrResult) {
			throw new IdAuthException("OCR解析异常");
		}
		return JacksonUtil.Json2Obj(ocrResult, new TypeReference<YTOCRResult>() {
		});
	}

	public YTFacePairResult getYTFacePairResult()
			throws IdAuthException, JsonParseException, JsonMappingException, IOException {
		if (null == facePairResult) {
			throw new IdAuthException("人脸识别异常");
		}
		return JacksonUtil.Json2Obj(facePairResult, new TypeReference<YTFacePairResult>() {
		});
	}

	public List<String> getFacebagArray() throws JsonParseException, JsonMappingException, IOException {
		if (null == facebag) {
			return null;
		} else {
			return JacksonUtil.Json2Obj(facebag, new TypeReference<List<String>>() {
			});
		}
	}

	public String getOcrResult() {
		return ocrResult;
	}

	public void setOcrResult(String ocrResult) {
		this.ocrResult = ocrResult;
	}

	public String getFacePairResult() {
		return facePairResult;
	}

	public void setFacePairResult(String facePairResult) {
		this.facePairResult = facePairResult;
	}

	public String getFacebag() {
		return facebag;
	}

	public void setFacebag(String facebag) {
		this.facebag = facebag;
	}

	public String getFacePairDes() {
		return facePairDes;
	}

	public void setFacePairDes(String facePairDes) {
		this.facePairDes = facePairDes;
	}

	public Integer getFacePairState() {
		return facePairState;
	}

	public void setFacePairState(Integer facePairState) {
		this.facePairState = facePairState;
	}

}
